<?php
	class Dichvu extends CI_Controller
    {
        public function __construct() {
            parent::__construct();
            $this->load->helper(array('url', 'text'));
        }
    
        public function index()
        {   
            $this->load->model('Nkdefault', 'default');    
            $this->load->model('admin/managethongbao', 'thongbao');        
            $temp['title'] = "Dịch vụ";
            $page = $this->input->get('page');
            $madanhmuc = $this->input->get('madanhmuc');
            $madanhmuc_cha = $this->input->get('madanhmuc_cha');
            $where = array('madanhmuc' => $madanhmuc, 'madanhmuc_cha' => $madanhmuc_cha);                        
            if($page != "" && $madanhmuc != "" && $madanhmuc_cha != "")            
            {
                $this->load->model('admin/managebaiviet', 'baiviet');                
                $baiviet = $this->baiviet->LoadBaiViet($where, null, null, 10, 0);
                if($baiviet->num_rows() > 0) $temp['data']['baiviet'] = $baiviet->result_array();
                $temp['template'] = 'dichvu';
                $temp['data']['info'] = $page;
            }            
            $temp['danhmuc']['menu'] = $this->default->loadDanhMuc();
            $temp['danhmuc']['currentItem'] = 'dichvu';     
            $temp['online'] = $this->useronline->countOnline();  
            //load thong bao
            $thongbao = $this->thongbao->LoadThongBao(null, null, 1, 0);
            if(!empty($thongbao)) $temp['thongbao'] = $thongbao->result_array();      
            $this->load->view('template/layout',$temp);
        }        
             
    }
?>